const state = () => ({
    position: {}
})

const mutations = {
    setPosition(state,val) {
        state.position = val
    },
    // change(state,city) {
    //     const storage = localStorage.getItem('city')
    //     console.log(storage)
    //     state.position.city = city
    // },
    changeCity(state,val) {
        state.position = val
    }
}

const actions = {
    setPosition: ({
        commit
    },position) => {
        commit('setPosition',position)
    },
    // change: ({
    //     commit
    // },data) => {
    //     commit('change',value)
    // }
    // change(ctx,value) {
    //     // ctx.commit('change',value)
    //     console.log(value)
    // }
    change(ctx,city) {
        ctx.commit('change',city)
    }
}


export default {
    namespaced: true,
    state,
    actions,
    mutations
}